#ifndef BJSAVED_H
#define BJSAVED_H

#include <string.h>
#include "shue.h"
#include "bjproto.h"

class BJSavedGame
{
	public:
        BJSavedGame()
        {
            maxBJBets=nBJBets=currentBJBet=0;
            for( int i=0; i<BJMAXBETS; i++ )
            {
                BJBets[i].numPlayerHands=0;
                BJBets[i].iBJBet=0;
                BJBets[i].bet=0;
                BJBets[i].m_insuranceState='N';

                // kharmon.  02-13-07.  #16101.  For Perfect Pairs.
                BJBets[i].nPPSideBet = 0;
                BJBets[i].nPPSideBetPayout = 0;
                BJBets[i].nPPWinType = 0;  
                memset(BJBets[i].gid,0,sizeof(BJBets[i].gid));  // kharmon.  05-04-07.  #19358.  Let's zero this out, for safety.
            }
        }

        ShueSave	shue;        
		int32		numDecks;
        bool8       bHasOriginalShoe;   // kharmon.  10-23-06.  #16151.  The shoe settings before any cards are dealt.        
        ShueSave	originalShoe;       

        uint8       maxBJBets;          // max number of BJBets the casino allows
        uint8       nBJBets;            // number of original bets placed
        uint8       currentBJBet;       // current BJBet's offset (0 or 1)
	    int32		currentHand;        // current hand in the current bet

        int32		numDealerCards;
		uint8		dealerCards[32];

        struct _BJBet
        {
	        char   	    gid[BJ_GAMEID_SIZE];
            int32		numPlayerHands;
            uint8		iBJBet;
            uint8		m_insuranceState;

		    int32		bet;

            struct _phand
		    {
			    uint8	m_nBets;		//doubled;
			    uint8	m_actionBits;	//actions
			    int32	numCards;
			    uint8	cards[32];
			    int32	bonusBalanceBet;
		    } hands[3];

            // kharmon.  02-13-07.  #16101.  For Perfect Pairs.
            int32 nPPSideBet;
            int32 nPPSideBetPayout;
            int32 nPPWinType;

        } BJBets[BJMAXBETS];
};

#endif
